package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	CheckProcessEventNew          = "mes.CheckProcessNew"
	CheckProcessEventBeforeCreate = "mes.CheckProcessBeforeCreate"
	CheckProcessEventBeforeUpdate = "mes.CheckProcessBeforeUpdate"
	CheckProcessEventBeforeSave   = "mes.CheckProcessBeforeCreate mes.CheckProcessBeforeUpdate"
	CheckProcessEventAfterCreate  = "mes.CheckProcessAfterCreate"
	CheckProcessEventAfterUpdate  = "mes.CheckProcessAfterUpdate"
	CheckProcessEventAfterSave    = "mes.CheckProcessAfterCreate mes.CheckProcessAfterUpdate"
	CheckProcessEventDelete       = "mes.CheckProcessDelete"

	CheckProcessAccessControlEvent = "mes.CheckProcessAccessControl"
)

func GetCheckProcessConfig() *mgo.DocConfig {
	return CheckProcess_Config
}

var CheckProcess_Config *mgo.DocConfig

func init() {
	CheckProcess_Config = NewCheckProcessConfig()
}

func NewCheckProcessConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "mes.CheckProcess",
		Fields: []string{
			"name", "department", "code",
		},
		RelationFields: []string{
			"department",
		},
		RelationConfigs: map[string]*mgo.DocRelation{

			"department": {
				Config:     GetDepartmentConfig,
				DocName:    "Department",
				JoinType:   "O",
				KeyInside:  "departmentId",
				KeyOutSide: "id",
			},
		},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
